package com.study.spring.ch08.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "/ch08/interceptor/**") // ①处理器的通用映射前缀
public class HelloWorldController {

	private static Log LOGGER = LogFactory.getLog(HelloWorldController.class);
	
	@RequestMapping("/redirect1")
	public String redirect1(Model model) {
		
		LOGGER.info("into redirect");
		return "ch08/index";
	}

	@RequestMapping("/resolver/forward")
	public String forward(Model model) {
		model.addAttribute("msg", "forward");
		return "forward:/WEB-INF/jsp/ch08/success.jsp";
	}

}
